<?php   if ( ! defined('BASEPATH')) exit('No direct script access allowed');

	function ip_address() 
    {
        //Obtain the IP address however you'd like, you may want to do additional validation, etc..
        $correct_ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];  
        return $correct_ip_address;
    }

    function isLogged() {
		$CI =& get_instance();
		if ($CI->session->userdata('user_id')) {
			return true;
		} else {
			return false;
		}
	}
	function json($data) {
	   return preg_replace("/\\\\u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", json_encode($data));
	}

	function css($class){
		$CI = & get_instance();
		switch ($class) {
			case 'home':
				# code...
				break;
			
			default:
				# code...
				break;
		}
	}